<template>
  <div class="inp-box grid">
    <dw-input v-model="value" placeholder="请输入待办事件" clearable @keyup.enter.native="add" />
    <dw-button type="primary" @click="add">提交</dw-button>
  </div>
</template>

<script>
export default {
  data() {
    return {
      value: null,
    };
  },

  methods: {
    add() {
      // console.log("submit", this.value);
      this.$emit("add", this.value, Date.now());
      this.value = null;
    },
  },
};
</script>

<style scpoed>
.inp-box {
  grid-template: 1fr / auto 60px;
  grid-column-gap: 20px;
}
</style>
